package com.njitzx;

import com.google.common.base.CaseFormat;

public class GuavaTest {
    public static void main(String[] args) {
        /**
         * guava工具库，Google提供的Java库
         */
        // 从大写驼峰转小写驼峰
        System.out.println(CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, "HelloWorld"));
        // 从小写驼峰转大写驼峰
        System.out.println(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, "helloWorld"));
        // 从大写驼峰转下划线
        System.out.println(CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, "HelloWorld"));
        // 从下划线转大写驼峰
        System.out.println(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, "hello_world"));
        // 从小写下划线转大写下划线
        System.out.println(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.UPPER_UNDERSCORE, "hello_world"));

    }
}
